﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace lcmyjobs.Web.users
{
    public partial class add_edu : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                txtmajor.Attributes.Add("readonly", "true");
                this.Title = string.Format("个人管理中心—我的简历：教育背景&bull;工作经验   {0}", Application["webname"].ToString());
                if (Session["user_id"] != null)
                {
                    int id = int.Parse(Session["user_id"].ToString());
                    this.lblName.Text = Session["user_name"].ToString();
                    show(id);
                    HyperLink1.NavigateUrl = "show_user-" + id + ".html";
                    HyperLink1.Target = "_blank";
                }
                else
                {
                    Response.Redirect("userlogin.html");
                }
            }

        }
        protected void show(int id)
        {
            lcmyjobs.BLL.user_basic bll = new lcmyjobs.BLL.user_basic();
            DataSet ds = bll.GetUserEdu(id);
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                DataTable dt = ds.Tables[0];//edus_id,school,eduyear,utype,workexp_id,[certificate],oldjobduty,honour,myvalution
                this.ddledu.SelectedValue = dt.Rows[0][0].ToString();
                this.DDL_EDU_TYPE.SelectedValue = dt.Rows[0]["edu_type"].ToString();
                this.txtschool.Text = dt.Rows[0][1].ToString();
                this.txteduyear.Text = dt.Rows[0][2].ToString();
                if (dt.Rows[0][3].ToString() == "1")
                {
                    this.rbtold.Checked = true;
                    rbtnew.Checked = false;
                }
                this.ddlExp.SelectedValue = dt.Rows[0][4].ToString();
                this.txtcertificate.Text = dt.Rows[0][5].ToString();
                this.txtoldjobduty.Text = dt.Rows[0][6].ToString();
                this.txthonour.Text = dt.Rows[0][7].ToString();
                this.txtmyvalution.Text = dt.Rows[0][8].ToString();
                //专业mid,majors_id,major_name,majors_other
                if (ds.Tables[1].Rows.Count != 0)
                {
                    string str = "";
                    hfmajor1.Value = "";
                    hfmajor1.Value += ds.Tables[1].Rows[0][0].ToString();
                    if (ds.Tables[1].Rows[0][3].ToString() == "")
                    {
                        str += ds.Tables[1].Rows[0][2].ToString();
                        if (ds.Tables[1].Rows.Count > 1)
                        {
                            hfmajor1.Value += "," + ds.Tables[1].Rows[1][0].ToString();
                            str += "," + ds.Tables[1].Rows[1][2].ToString();

                        }
                    }
                    else
                    {
                        txtmajorother.Text = ds.Tables[1].Rows[0][3].ToString();

                    }
                    hfmajor2.Value = str;
                }
                //外语lid,languages_id,languageslevel
                if (ds.Tables[2].Rows.Count != 0)
                {
                    hflanguage1.Value = "";
                    hflanguage2.Value = "";
                    for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                    {
                        hflanguage1.Value += ds.Tables[2].Rows[i][0].ToString() + ",";
                        hflanguage2.Value += ds.Tables[2].Rows[i][1].ToString() + "," + ds.Tables[2].Rows[i][2].ToString() + ",";
                    }
                    hflanguage1.Value = hflanguage1.Value.Substring(0, hflanguage1.Value.Length - 1);
                    hflanguage2.Value = hflanguage2.Value.Substring(0, hflanguage2.Value.Length - 1);

                }
                //工作wid,wunit,trades_id,tradename,job,jobtime
                if (ds.Tables[3].Rows.Count != 0)
                {
                    hfoldjob1.Value = "";
                    hfoldjob2.Value = "";
                    for (int i = 0; i < ds.Tables[3].Rows.Count; i++)
                    {
                        hfoldjob1.Value += ds.Tables[3].Rows[i][0].ToString() + "|";
                        hfoldjob2.Value += ds.Tables[3].Rows[i][1].ToString() + "|" + ds.Tables[3].Rows[i][3].ToString() + "|" + ds.Tables[3].Rows[i][4].ToString() + "|" + ds.Tables[3].Rows[i][5].ToString() + "|";
                    }
                    hfoldjob1.Value = hfoldjob1.Value.Substring(0, hfoldjob1.Value.Length - 1);
                    hfoldjob2.Value = hfoldjob2.Value.Substring(0, hfoldjob2.Value.Length - 1);

                }


            }



        }
        protected void gethf(int id)
        {
            lcmyjobs.BLL.user_basic bll = new lcmyjobs.BLL.user_basic();
            DataSet ds = bll.GetUserEdu(id);
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                DataTable dt = ds.Tables[0];//edus_id,school,eduyear,utype,workexp_id,[certificate],oldjobduty,honour,myvalution
                //专业mid,majors_id,major_name,majors_other
                if (ds.Tables[1].Rows.Count != 0)
                {
                    string str = "";
                    hfmajor1.Value = "";
                    hfmajor1.Value += ds.Tables[1].Rows[0][0].ToString();
                    if (ds.Tables[1].Rows[0][3].ToString() == "")
                    {
                        str += ds.Tables[1].Rows[0][2].ToString();
                        if (ds.Tables[1].Rows.Count > 1)
                        {
                            hfmajor1.Value += "," + ds.Tables[1].Rows[1][0].ToString();
                            str += "," + ds.Tables[1].Rows[1][2].ToString();

                        }
                    }
                    else
                    {
                        txtmajorother.Text = ds.Tables[1].Rows[0][3].ToString();

                    }
                    hfmajor2.Value = str;
                }
                //外语lid,languages_id,languageslevel
                if (ds.Tables[2].Rows.Count != 0)
                {
                    hflanguage1.Value = "";
                    hflanguage2.Value = "";
                    for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                    {
                        hflanguage1.Value += ds.Tables[2].Rows[i][0].ToString() + ",";
                        hflanguage2.Value += ds.Tables[2].Rows[i][1].ToString() + "," + ds.Tables[2].Rows[i][2].ToString() + ",";
                    }
                    hflanguage1.Value = hflanguage1.Value.Substring(0, hflanguage1.Value.Length - 1);
                    hflanguage2.Value = hflanguage2.Value.Substring(0, hflanguage2.Value.Length - 1);

                }
                //工作wid,wunit,trades_id,tradename,job,jobtime
                if (ds.Tables[3].Rows.Count != 0)
                {
                    hfoldjob1.Value = "";
                    hfoldjob2.Value = "";
                    for (int i = 0; i < ds.Tables[3].Rows.Count; i++)
                    {
                        hfoldjob1.Value += ds.Tables[3].Rows[i][0].ToString() + "|";
                        hfoldjob2.Value += ds.Tables[3].Rows[i][1].ToString() + "|" + ds.Tables[3].Rows[i][3].ToString() + "|" + ds.Tables[3].Rows[i][4].ToString() + "|" + ds.Tables[3].Rows[i][5].ToString() + "|";
                    }
                    hfoldjob1.Value = hfoldjob1.Value.Substring(0, hfoldjob1.Value.Length - 1);
                    hfoldjob2.Value = hfoldjob2.Value.Substring(0, hfoldjob2.Value.Length - 1);

                }


            }



        }

        protected void btnedu_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (Session["user_id"] != null)
                {
                    int uid = int.Parse(Session["user_id"].ToString());

                    // chg by liuhui v001 (wid4, wunit4 = "", tradesname4 = "", job4 = "", jobtime4 = "";)
                    int mid1 = 0, mid2 = 0, lid1 = 0, lid2 = 0, languages_id1 = 0, languages_id2 = 0, languageslevel1 = 0, languageslevel2 = 0, wid1 = 0, wid2 = 0, wid3 = 0, wid4 = 0;
                    string majors_id1 = "", majors_id2 = "", majors_other = "", wunit1 = "", tradesname1 = "", job1 = "", jobtime1 = "", wunit2 = "", tradesname2 = "", job2 = "", jobtime2 = "", wunit3 = "", tradesname3 = "", job3 = "", jobtime3 = "", wunit4 = "", tradesname4 = "", job4 = "", jobtime4 = "";
                    int wid5 = 0, wid6 = 0, wid7 = 0, wid8 = 0, wid9 = 0, wid10 = 0;
                    string wunit5 = "", tradesname5 = "", job5 = "", jobtime5 = "", wunit6 = "", tradesname6 = "", job6 = "", jobtime6 = "", wunit7 = "", tradesname7 = "", job7 = "", jobtime7 = "", wunit8 = "", tradesname8 = "", job8 = "", jobtime8 = "", wunit9 = "", tradesname9 = "", job9 = "", jobtime9 = "", wunit10 = "", tradesname10 = "", job10 = "", jobtime10 = "";
					
					//int mid1 = 0, mid2 = 0, lid1 = 0, lid2 = 0, languages_id1 = 0, languages_id2 = 0, languageslevel1 = 0, languageslevel2 = 0, wid1 = 0, wid2 = 0, wid3 = 0;
					
                    if (hfmajor1.Value != "")
                    {
                        mid1 = int.Parse(hfmajor1.Value.Split(',')[0]);
                        if (hfmajor1.Value.Split(',').Length > 1)
                            mid2 = int.Parse(hfmajor1.Value.Split(',')[1]);
                    }
                    if (txtmajorother.Text == "若无合适选项在此处填写")
                    {
                        string[] majors = txtmajor.Text.Split(',');
                        majors_id1 = majors[0];
                        if (majors.Length > 1) majors_id2 = majors[1];
                    }
                    else
                        majors_other = txtmajorother.Text;
                    if (hflanguage1.Value != "")
                    {
                        lid1 = int.Parse(hflanguage1.Value.Split(',')[0]);
                        if (hflanguage1.Value.Split(',').Length > 1)
                            lid2 = int.Parse(hflanguage1.Value.Split(',')[1]);
                    }
                    if (hflanguage.Value != "")
                    {
                        languages_id1 = int.Parse(hflanguage.Value.Split('|')[0].Split(',')[0]);
                        languageslevel1 = int.Parse(hflanguage.Value.Split('|')[0].Split(',')[1]);
                        if (hflanguage.Value.Split('|').Length > 1)
                        {
                            languages_id2 = int.Parse(hflanguage.Value.Split('|')[1].Split(',')[0]);
                            languageslevel2 = int.Parse(hflanguage.Value.Split('|')[1].Split(',')[1]);
                        }
                    }
                    if (hfoldjob1.Value != "")
                    {
                        wid1 = int.Parse(hfoldjob1.Value.Split('|')[0]);
                        if (hfoldjob1.Value.Split('|').Length > 1)
                            wid2 = int.Parse(hfoldjob1.Value.Split('|')[1]);
                        if (hfoldjob1.Value.Split('|').Length > 2)
                            wid3 = int.Parse(hfoldjob1.Value.Split('|')[2]);
                        if (hfoldjob1.Value.Split('|').Length > 3)
                            wid4 = int.Parse(hfoldjob1.Value.Split('|')[3]);
                        if (hfoldjob1.Value.Split('|').Length > 4)
                            wid5 = int.Parse(hfoldjob1.Value.Split('|')[4]);
                        if (hfoldjob1.Value.Split('|').Length > 5)
                            wid6 = int.Parse(hfoldjob1.Value.Split('|')[5]);
                        if (hfoldjob1.Value.Split('|').Length > 6)
                            wid7 = int.Parse(hfoldjob1.Value.Split('|')[6]);
                        if (hfoldjob1.Value.Split('|').Length > 7)
                            wid8 = int.Parse(hfoldjob1.Value.Split('|')[7]);
                        if (hfoldjob1.Value.Split('|').Length > 8)
                            wid9 = int.Parse(hfoldjob1.Value.Split('|')[8]);
                        if (hfoldjob1.Value.Split('|').Length > 9)
                            wid10 = int.Parse(hfoldjob1.Value.Split('|')[9]);
                    }
                    if (hfoldjob.Value != "")
                    {
                        string[] jobs = hfoldjob.Value.Split('|');
                        wunit1 = jobs[0];
                        tradesname1 = jobs[1];
                        job1 = jobs[2];
                        jobtime1 = jobs[3];
                        if (jobs.Length > 5)
                        {
                            wunit2 = jobs[4];
                            tradesname2 = jobs[5];
                            job2 = jobs[6];
                            jobtime2 = jobs[7];
                        }
                        if (jobs.Length > 9)
                        {
                            wunit3 = jobs[8];
                            tradesname3 = jobs[9];
                            job3 = jobs[10];
                            jobtime3 = jobs[11];
                        }
                        
                        if (jobs.Length > 13)
                        {
                            wunit4 = jobs[12];
                            tradesname4 = jobs[13];
                            job4 = jobs[14];
                            jobtime4 = jobs[15];
                        }

                        if (jobs.Length > 17)
                        {
                            wunit5 = jobs[16];
                            tradesname5 = jobs[17];
                            job5 = jobs[18];
                            jobtime5 = jobs[19];
                        }

                        if (jobs.Length > 21)
                        {
                            wunit6 = jobs[20];
                            tradesname6 = jobs[21];
                            job6 = jobs[22];
                            jobtime6 = jobs[23];
                        }

                        if (jobs.Length > 25)
                        {
                            wunit7 = jobs[24];
                            tradesname7 = jobs[25];
                            job7 = jobs[26];
                            jobtime7 = jobs[27];
                        }

                        if (jobs.Length > 29)
                        {
                            wunit8 = jobs[28];
                            tradesname8 = jobs[29];
                            job8 = jobs[30];
                            jobtime8 = jobs[31];
                        }

                        if (jobs.Length > 33)
                        {
                            wunit9 = jobs[32];
                            tradesname9 = jobs[33];
                            job9 = jobs[34];
                            jobtime9 = jobs[35];
                        }

                        if (jobs.Length > 37)
                        {
                            wunit10 = jobs[36];
                            tradesname10 = jobs[37];
                            job10 = jobs[38];
                            jobtime10 = jobs[39];
                        }
                  
                    }


                    SqlParameter[] parameters = {			 
			 			 new SqlParameter("@uid", SqlDbType.Int,4),                     // 0
			 			 new SqlParameter("@oldjobduty", SqlDbType.NVarChar,500),       // 1
			 			 new SqlParameter("@honour", SqlDbType.NVarChar,500),           // 2
			 			 new SqlParameter("@myvalution", SqlDbType.NVarChar,500),       // 3
			 			 new SqlParameter("@mid1", SqlDbType.Int,4),                    // 4
			 			 new SqlParameter("@mid2", SqlDbType.Int,4),                    // 5
			 			 new SqlParameter("@majors_name1", SqlDbType.NVarChar,20),      // 6
			 			 new SqlParameter("@majors_name2", SqlDbType.NVarChar,20),      // 7
			 			 new SqlParameter("@majors_other", SqlDbType.NVarChar,20),      // 8
			 			 new SqlParameter("@lid1", SqlDbType.Int,4),                    // 9
			 			 new SqlParameter("@lid2", SqlDbType.Int,4),                    // 10
			 			 new SqlParameter("@edus_id", SqlDbType.Int,4),                 // 11
			 			 new SqlParameter("@languages_id1", SqlDbType.Int,4),           // 12
			 			 new SqlParameter("@languages_id2", SqlDbType.Int,4),           // 13
			 			 new SqlParameter("@languageslevel1", SqlDbType.TinyInt,1),     // 14
			 			 new SqlParameter("@languageslevel2", SqlDbType.TinyInt,1),     // 15
			 			 new SqlParameter("@wid1", SqlDbType.Int,4),                    // 16
			 			 new SqlParameter("@wunit1", SqlDbType.VarChar,30),             // 17
			 			 new SqlParameter("@tradesname1", SqlDbType.NVarChar,20),       // 18
			 			 new SqlParameter("@job1", SqlDbType.VarChar,40),               // 19
			 			 new SqlParameter("@jobtime1", SqlDbType.VarChar,30),           // 20
			 			 new SqlParameter("@wid2", SqlDbType.Int,4),                    // 21
			 			 new SqlParameter("@school", SqlDbType.VarChar,50),             // 22
			 			 new SqlParameter("@wunit2", SqlDbType.VarChar,30),             // 23
			 			 new SqlParameter("@tradesname2", SqlDbType.NVarChar,20),       // 24
			 			 new SqlParameter("@job2", SqlDbType.VarChar,40),               // 25
			 			 new SqlParameter("@jobtime2", SqlDbType.VarChar,30),           // 26
			 			 new SqlParameter("@wid3", SqlDbType.Int,4),                    // 27
			 			 new SqlParameter("@wunit3", SqlDbType.VarChar,30),             // 28
			 			 new SqlParameter("@tradesname3", SqlDbType.NVarChar,20),       // 29
			 			 new SqlParameter("@job3", SqlDbType.VarChar,40),               // 30
			 			 new SqlParameter("@jobtime3", SqlDbType.VarChar,30),           // 31
			 			 new SqlParameter("@eduyear", SqlDbType.Char,4),                // 32
			 			 new SqlParameter("@utype", SqlDbType.TinyInt,1),               // 33
			 			 new SqlParameter("@workexp_id", SqlDbType.Int,4),			    // 34	
			 			 new SqlParameter("@certificate", SqlDbType.NVarChar,500),      // 35
                         new SqlParameter("@wid4", SqlDbType.Int,4),                    // 36
			 			 new SqlParameter("@wunit4", SqlDbType.VarChar,30),             // 37
			 			 new SqlParameter("@tradesname4", SqlDbType.NVarChar,20),       // 38
			 			 new SqlParameter("@job4", SqlDbType.VarChar,40),               // 39
			 			 new SqlParameter("@jobtime4", SqlDbType.VarChar,30),           // 40
                         new SqlParameter("@wid5", SqlDbType.Int,4),                    // 41
			 			 new SqlParameter("@wunit5", SqlDbType.VarChar,30),             // 42
			 			 new SqlParameter("@tradesname5", SqlDbType.NVarChar,20),       // 43
			 			 new SqlParameter("@job5", SqlDbType.VarChar,40),               // 44
			 			 new SqlParameter("@jobtime5", SqlDbType.VarChar,30),           // 45
                         new SqlParameter("@wid6", SqlDbType.Int,4),                    // 46
			 			 new SqlParameter("@wunit6", SqlDbType.VarChar,30),             // 47
			 			 new SqlParameter("@tradesname6", SqlDbType.NVarChar,20),       // 48
			 			 new SqlParameter("@job6", SqlDbType.VarChar,40),               // 49
			 			 new SqlParameter("@jobtime6", SqlDbType.VarChar,30),           // 50
                         new SqlParameter("@wid7", SqlDbType.Int,4),                    // 51
			 			 new SqlParameter("@wunit7", SqlDbType.VarChar,30),             // 52
			 			 new SqlParameter("@tradesname7", SqlDbType.NVarChar,20),       // 53
			 			 new SqlParameter("@job7", SqlDbType.VarChar,40),               // 54
			 			 new SqlParameter("@jobtime7", SqlDbType.VarChar,30),           // 55
                         new SqlParameter("@wid8", SqlDbType.Int,4),                    // 56
			 			 new SqlParameter("@wunit8", SqlDbType.VarChar,30),             // 57
			 			 new SqlParameter("@tradesname8", SqlDbType.NVarChar,20),       // 58
			 			 new SqlParameter("@job8", SqlDbType.VarChar,40),               // 59
			 			 new SqlParameter("@jobtime8", SqlDbType.VarChar,30),           // 60
                         new SqlParameter("@wid9", SqlDbType.Int,4),                    // 61
			 			 new SqlParameter("@wunit9", SqlDbType.VarChar,30),             // 62
			 			 new SqlParameter("@tradesname9", SqlDbType.NVarChar,20),       // 63
			 			 new SqlParameter("@job9", SqlDbType.VarChar,40),               // 64
			 			 new SqlParameter("@jobtime9", SqlDbType.VarChar,30),           // 65
                         new SqlParameter("@wid10", SqlDbType.Int,4),                   // 66
			 			 new SqlParameter("@wunit10", SqlDbType.VarChar,30),            // 67
			 			 new SqlParameter("@tradesname10", SqlDbType.NVarChar,20),      // 68
			 			 new SqlParameter("@job10", SqlDbType.VarChar,40),              // 69
			 			 new SqlParameter("@jobtime10", SqlDbType.VarChar,30),          // 70
                         new SqlParameter("@edu_type", SqlDbType.Int,4)                 // 71
			 			 };
                    parameters[0].Value = uid;
                    parameters[1].Value = Server.HtmlEncode(this.txtoldjobduty.Text);
                    parameters[2].Value = Server.HtmlEncode(this.txthonour.Text);
                    parameters[3].Value = Server.HtmlEncode(this.txtmyvalution.Text);
                    if (mid1 == 0)
                        parameters[4].Value = DBNull.Value;
                    else
                        parameters[4].Value = mid1;
                    if (mid2 == 0)
                        parameters[5].Value = DBNull.Value;
                    else
                        parameters[5].Value = mid2;
                    if (majors_id1 == "")
                        parameters[6].Value = DBNull.Value;
                    else
                        parameters[6].Value = majors_id1;
                    if (majors_id2 == "")
                        parameters[7].Value = DBNull.Value;
                    else
                        parameters[7].Value = majors_id2;
                    if (txtmajorother.Text != "若无合适选项在此处填写")
                        parameters[8].Value = majors_other;
                    if (lid1 == 0)
                        parameters[9].Value = DBNull.Value;
                    else
                        parameters[9].Value = lid1;
                    if (lid2 == 0)
                        parameters[10].Value = DBNull.Value;
                    else
                        parameters[10].Value = lid2;
                    parameters[11].Value = int.Parse(this.ddledu.SelectedValue);
                    if (languages_id1 != 0)
                    {
                        parameters[12].Value = languages_id1;
                        parameters[14].Value = languageslevel1;
                    }
                    if (languages_id2 != 0)
                    {
                        parameters[13].Value = languages_id2;
                        parameters[15].Value = languageslevel2;
                    }
                    if (wid1 != 0)
                        parameters[16].Value = wid1;
                    if (wunit1 != "")
                    {
                        parameters[17].Value = wunit1;
                        parameters[18].Value = tradesname1;
                        parameters[19].Value = job1;
                        parameters[20].Value = jobtime1;
                    }
                    if (wid2 != 0)
                        parameters[21].Value = wid2;
                    parameters[22].Value = this.txtschool.Text;
                    if (wunit2 != "")
                    {
                        parameters[23].Value = wunit2;
                        parameters[24].Value = tradesname2;
                        parameters[25].Value = job2;
                        parameters[26].Value = jobtime2;
                    }
                    if (wid3 != 0)
                        parameters[27].Value = wid3;
                    if (wunit3 != "")
                    {
                        parameters[28].Value = wunit3;
                        parameters[29].Value = tradesname3;
                        parameters[30].Value = job3;
                        parameters[31].Value = jobtime3;
                    }


                    parameters[32].Value = this.txteduyear.Text;
                    parameters[33].Value = rbtnew.Checked ? 2 : 1;
                    parameters[34].Value = ddlExp.SelectedValue;
                    parameters[35].Value = Server.HtmlEncode(this.txtcertificate.Text);
                    
                    // 第四项工作经验v001
                    if (wid4 != 0)
                        parameters[36].Value = wid4;
                    if (wunit4 != "")
                    {
                        parameters[37].Value = wunit4;
                        parameters[38].Value = tradesname4;
                        parameters[39].Value = job4;
                        parameters[40].Value = jobtime4;
                    }
                    if (wid5 != 0)
                        parameters[41].Value = wid5;
                    if (wunit5 != "")
                    {
                        parameters[42].Value = wunit5;
                        parameters[43].Value = tradesname5;
                        parameters[44].Value = job5;
                        parameters[45].Value = jobtime5;
                    }
                    if (wid6 != 0)
                        parameters[46].Value = wid6;
                    if (wunit6 != "")
                    {
                        parameters[47].Value = wunit6;
                        parameters[48].Value = tradesname6;
                        parameters[49].Value = job6;
                        parameters[50].Value = jobtime6;
                    }
                    if (wid7 != 0)
                        parameters[51].Value = wid7;
                    if (wunit7 != "")
                    {
                        parameters[52].Value = wunit7;
                        parameters[53].Value = tradesname7;
                        parameters[54].Value = job7;
                        parameters[55].Value = jobtime7;
                    }
                    if (wid8 != 0)
                        parameters[56].Value = wid8;
                    if (wunit8 != "")
                    {
                        parameters[57].Value = wunit8;
                        parameters[58].Value = tradesname8;
                        parameters[59].Value = job8;
                        parameters[60].Value = jobtime8;
                    }
                    if (wid9 != 0)
                        parameters[61].Value = wid9;
                    if (wunit9 != "")
                    {
                        parameters[62].Value = wunit9;
                        parameters[63].Value = tradesname9;
                        parameters[64].Value = job9;
                        parameters[65].Value = jobtime9;
                    }
                    if (wid10 != 0)
                        parameters[66].Value = wid10;
                    if (wunit10 != "")
                    {
                        parameters[67].Value = wunit10;
                        parameters[68].Value = tradesname10;
                        parameters[69].Value = job10;
                        parameters[70].Value = jobtime10;
                    }

                    parameters[71].Value = int.Parse(this.DDL_EDU_TYPE.SelectedValue);

                    BLL.user_basic bub = new BLL.user_basic();
                    try
                    {
                        bub.addedu(parameters);
                        //更新hf如跳转就不用更新
                        gethf(uid);
                        //hfoldjob.Value= parameters.ToString();
                        //hfoldjob1.Value = "test";
                        //hfoldjob2.Value = parameters[37].Value.ToString();
                        Maticsoft.Common.MessageBox.Show(this, "保存成功！");
                        //Maticsoft.Common.MessageBox.Show(this, parameters.ToString());

                    }
                    catch (Exception ex)
                    {
                        hfoldjob2.Value = "test";
                        Maticsoft.Common.MessageBox.Show(this, "保存失败！" + ex.Message.ToString());
                    }
                }
                else
                {
                    Response.Redirect("userlogin.html");
                }
            }
        }

        
    }
}